﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace 考勤信息管理
{
    public partial class RecordForm : Form
    {
        public RecordForm(Dictionary<SE,Record> d)
        {
            InitializeComponent();
            foreach (var item in d)
            {
                if (item.Value.Signined == true)
                {
                    string name = item.Key.Name;
                    string datet = item.Value.SignInTime.ToString();
                    //动态增加
                    int index = this.dataGridView1.Rows.Add();
                    this.dataGridView1.Rows[index].Cells[0].Value = name;
                    this.dataGridView1.Rows[index].Cells[1].Value = "签到";
                    this.dataGridView1.Rows[index].Cells[2].Value = datet;
                }
                if (item.Value.SignOuted == true)
                {
                    string name = item.Key.Name;
                    string datet = item.Value.SignOutTime.ToString();
                    //动态增加
                    int index = this.dataGridView1.Rows.Add();
                    this.dataGridView1.Rows[index].Cells[0].Value = name;
                    this.dataGridView1.Rows[index].Cells[1].Value = "签退";
                    this.dataGridView1.Rows[index].Cells[2].Value = datet;
                }

            }
        }
    }
}
